#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>

class Solution {
public:
    bool canPermutePalindrome(string s) {
        int count[128] = { 0 };
        for (auto ch : s)
        {
            if (count[ch] == 0)
            {
                count[ch]++;
            }
            else
            {
                count[ch]--;
            }
        }
        int ret = 0;
        for (auto ch : count)
        {
            ret += ch;
        }
        if (ret > 1)
        {
            return false;
        }
        return true;
    }
};

int pivotIndex(int* nums, int numsSize) {
    int i = 0;
    int mid = -1;
    for (i = 0; i < numsSize; i++)
    {
        int left = 0;
        int right = 0;
        int j = 0;
        for (j = 0; j < i; j++)
        {
            left += nums[j];
        }
        for (j = i + 1; j < numsSize; j++)
        {
            right += nums[j];
        }
        if (left == right)
        {
            mid = i;
            return mid;
        }
    }
    return mid;
}